class CreateDeclarationPayers < ActiveRecord::Migration
  def self.up
    transaction do
      create_table :declaration_payers do |table|
        table.column :declaration_id, :integer, :null => false
        table.column :user_id, :integer, :null => false
        table.column :additional_persons, :integer
      end
    end
    
    #Ervoor zorgen dat declaratie/user maar ��n keer voorkomt
    add_index(:declaration_payers, [:declaration_id, :user_id], :unique => true)
    
  end
  
  def self.down
    drop_table :declaration_payers
  end
end